<script lang="ts">
import { defineComponent, ref, onMounted, watch } from 'vue'
import { useRouter, useRoute } from 'vue-router'
export default defineComponent({
    setup() {
        let router: any = useRouter();
        let route: any = useRoute();
        let payClassjson: any = localStorage.getItem("payClass");
        let payClass: any = ref(JSON.parse(payClassjson) || []);
        let groupId = route.query.groupId;
        let currentOrder = payClass.value.filter((item: any) => item.groupId == groupId)
        console.log('1', currentOrder)
        let back = () => {
            router.back();

        }
        return {
            back,
            currentOrder
        }
    }

})
</script>
<template>
    <div>
        <div class="desbar">
            <span class="iconfont icon-xiangzuojiantou" @click="back"> </span>
            <h2>订单详情</h2>
        </div>
        <div class="orderdes">
            <div class="order">
                <div class="image"
                    :style="'background:url(' + currentOrder[0].data.avatar + ') center -10px/ 85% no-repeat'">
                    <!-- <img :src="currentOrder[0].data.avatar" alt=""> -->
                </div>
                <div class="des">
                    <span>{{ currentOrder[0].data.groupName }}</span>
                    <p>{{ currentOrder[0].data.ownerInfo.nickName }}</p>
                    <em>￥{{ currentOrder[0].price }}</em>
                </div>
            </div>
            <div class="other">

            </div>
        </div>
        <div class="list">
            <p>实付款</p>
            <p>￥{{ currentOrder[0].price }}</p>
        </div>
        <div class="list">
            <p>订单时间</p>
            <p>{{ currentOrder[0].newtime }}</p>
        </div>
        <div class="list">
            <p>备注</p>
            <p>{{ currentOrder[0].userinput }}</p>
        </div>
    </div>
</template>
<style lang="scss" scoped>
.desbar {
    display: flex;
    line-height: 44px;
    padding: 0 10px;
    position: sticky;
    z-index: 10;
    top: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #ede5e5;

    span {
        font-size: 18px;
        font-weight: 600;
    }

    h2 {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        font-size: 16px;

        // margin-left: 50px;
    }
}

.orderdes {
    padding: 0 15px;
    margin-bottom: 50px;

    .order {
        display: flex;

        .image {
            width: 200px;
            height: 100px;

            img {
                width: 200px;
                height: 100px;
            }
        }

        .des {
            color: #a8a5a5;
            font-size: 14px;
            display: flex;
            flex-direction: column;
            justify-content: space-around;

            span {
                font-size: 16px;
                font-weight: 600;
                color: #000;
                line-height: 20px;
            }

            em {
                color: red;
                font-weight: 600;
                margin-top: 10px;

            }
        }
    }
}

.list {
    margin: 0 32px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    line-height: 50px;
    border-bottom: 1px solid #f7f4f4;
}
</style>